package cn.com.open.opensaas.answerservice;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
@EnableTransactionManagement
@EnableDiscoveryClient
@EnableFeignClients
@RefreshScope
public class AnswerserviceApplication {


	@Value("${app.name}")
	private String name;

	@RequestMapping(value = "/health", method = RequestMethod.GET)
	public String health() {
		return name;
	}

	@RequestMapping(value = "/version", method = RequestMethod.GET)
	public String version() {
		return name;
	}


	@RequestMapping("/dnotdelet/mom.html")
	public String home (){
		return "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"></head><body>helloworld</body></html>";
	}

	public static void main(String[] args) {
		SpringApplication.run(AnswerserviceApplication.class, args);
	}
}
